package com.mrtan.vo;

import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Data
public class AccountInsertVO {
    @NotBlank(message = "用户名不能为空")
    @Length(min = 5, max = 20, message = "用户名长度必须在5~20之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "用户名只能包含字母数字下划线")
    @Pattern(regexp = "^[a-zA-Z]", message = "用户名必须以字母开头")
    private String username;
    @NotBlank(message = "密码不能为空")
    @Length(min = 3, max = 20, message = "密码长度必须在3~20之间")
    @Pattern(regexp = "^[a-zA-Z0-9_]+$", message = "用户名只能包含字母数字下划线")
    private String password;
}
